<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

</head>

<body>
    <h2 align='center'>
        <div id="app">
            <p>{{message}}</p>
            <br>
            <p>{{message|toupper}}</p>
            <hr>
            <p>现在的vue。js学习进度是{{num}}({{num|topercentage}})</p>

            <br><br><br>

            <p>我想买一台新相机📷(6400a),它的价格是{{price}}元,但经过涨价成了{{priceNew}}元,大致也就还是{{priceAbout}}元。。还是买不起</p>
        </div>
    </h2>
    <script src="../js/vue.js"></script>
    <script>
        let app = new Vue({
            el: '#app',
            data: {
                message: 'vueDemo',
                num: 0.3,
                price: 7200
            },
            filters: {//过滤器
                toupper: function (value) {
                    return value.toUpperCase()
                },
                topercentage: function (value) {
                    return value * 100 + '%'
                }
            },
            computed: {//计算属性
                priceNew: function () { //现在价格
                    return this.price * 1.08
                },
                priceAbout: function () { //大致价格
                    return Math.round(this.priceNew)
                }
            },
            watch:{
                
            }
        })
    </script>
</body>

</html>